package net.entelijan.cobean.notification;

import java.awt.BorderLayout;
import java.awt.Container;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

import net.entelijan.cobean.core.ColumnDesc;
import net.entelijan.cobean.core.IMultiSelectionListCobean;
import net.entelijan.cobean.core.ISingleSelectionListCobean;
import net.entelijan.cobean.core.SelectionMode;
import net.entelijan.cobean.core.impl.IPropertyChangeListenerAware;
import net.entelijan.cobean.table.DefaultSingleSelectionTableInitializer;
import net.entelijan.cobean.table.DefaultTableInitializer;
import net.entelijan.testutil.CobeanTestUtil;
import net.entelijan.testutil.SimpleBean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@SuppressWarnings("unused")
public class TableNotificationTestFrame extends JFrame {

	private static final long serialVersionUID = 1L;

	private static Log log = LogFactory
			.getLog(TableNotificationTestFrame.class);

	private JTable table = createTable("table");

	private JTextField filterTextField = createTextField("filterTextField");

	public TableNotificationTestFrame(String title) {
		super(title);
		CobeanTestUtil.setComponentNamesFromPropertyNames(this);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		final Container cp = getContentPane();
		cp.setLayout(new BorderLayout());
		cp.add(this.filterTextField, BorderLayout.NORTH);
		cp.add(new JScrollPane(table), BorderLayout.CENTER);
		setSize(150, 100);
	}

	private JTable createTable(String name) {
		JTable re = new JTable();
		re.setName(name);
		return re;
	}

	private JTextField createTextField(String name) {
		JTextField re = new JTextField();
		re.setName(name);
		return re;
	}

	public JTable getTable() {
		return table;
	}

	public void setTable(JTable table) {
		this.table = table;
	}

	public JTextField getFilterTextField() {
		return filterTextField;
	}

	public void setFilterTextField(JTextField filterTextField) {
		this.filterTextField = filterTextField;
	}

}
